package com.jy.api.enums;

import java.util.ArrayList;
import java.util.List;

public enum WechatTemplateCodeEnum {


    ZERO("会员消费模版", "6f5ZnNe0k9YXapM7TMQzRvU0lT-FqDniVUlHbHQ-dto"),
    ONE("成为会员模版", "9_zMAnALrkxq1pb4yBjtAjIJJfyyMXcOhSrntLejv-I"),
    TWO("会员充值模版", "_SIEvyMoQdjKnpDzyPTgde4MOqaIX3MIVzwgghUA9BA"),
    THREE("退款成功通知模版", "IuvScScRAqguHrkiNRndElWaOWUiLbZ6cZBJQZ4y2B0"),
    FOUR("退款通知", "aDvxRUdxMscXBWHDO3N9Khju7mJ3wyRZuv7bTIvglvs"),
    FIVE("交班信息推送", "yhGv2hl6vpjcnAIt7b_GeHDDIWgRTKGOhyIDKIVRmfU");

    /**
     * 枚举值
     */
    private final String code;

    /**
     * 枚举描述
     */
    private final String message;

    /**
     * 构造一个<code>LocalCacheEnum</code>枚举对象
     *
     * @param code
     * @param message
     */
    private WechatTemplateCodeEnum(String code, String message) {
        this.code = code;
        this.message = message;
    }

    /**
     * @return Returns the code.
     */
    public String getCode() {
        return code;
    }

    /**
     * @return Returns the message.
     */
    public String getMessage() {
        return message;
    }

    /**
     * @return Returns the code.
     */
    public String code() {
        return code;
    }

    /**
     * @return Returns the message.
     */
    public String message() {
        return message;
    }

    /**
     * 通过枚举<code>code</code>获得枚举
     *
     * @param code
     * @return LocalCacheEnum
     */
    public static String getByCode(String code) {
        for (WechatTemplateCodeEnum _enum : values()) {
            if (_enum.getCode().equals(code)) {
                return _enum.getMessage();
            }
        }
        return null;
    }

    /**
     * 获取全部枚举
     *
     * @return List<LocalCacheEnum>
     */
    public List<WechatTemplateCodeEnum> getAllEnum() {
        List<WechatTemplateCodeEnum> list = new ArrayList<WechatTemplateCodeEnum>();
        for (WechatTemplateCodeEnum _enum : values()) {
            list.add(_enum);
        }
        return list;
    }

    /**
     * 获取全部枚举值
     *
     * @return List<String>
     */
    public List<String> getAllEnumCode() {
        List<String> list = new ArrayList<String>();
        for (WechatTemplateCodeEnum _enum : values()) {
            list.add(_enum.code());
        }
        return list;
    }
}
